<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
	prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
	prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"
	prefix="logic"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
	<head>
		<title>page of team-manage</title>
		<LINK href="css/default.css" rel=stylesheet>
		<style type="text/css">
#id1 {
	width: 100%;
	height: 100%;
	background-color: #000;
	FILTER: alpha(opacity =                                       50);
	position: absolute;
	top: 0;
	left: 0;
	moz-opacity: 0.8;
	opacity: .80;
	z-index: 49;
}

#id2 {
	top: 10px;
	position: absolute;
	z-index: 99;
	border: 3px solid #E5E5E5;
	left: 100px;
	font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	background-color: #F5FAFA;
}
</style>
		<script language="javascript" type="text/javascript">
		function show(){
		document.all.id1.style.height=document.body.scrollHeight+"px";
		document.all.id1.style.width=document.body.scrollWidth+"px";
		document.all.id1.style.display="";
		document.all.id2.style.display="";
		}
		function hide(){
		document.all.id1.style.display="none";
		document.all.id2.style.display="none";
		}
		function opchange(o){
		document.sysRoleForm.method.value=o;
		document.sysRoleForm.submit();
		}
		</script>
		<script language="javascript" type="text/javascript"
			src="js/dragelement.js" /></script>
	</head>
	<body>
		<logic:present name="sysRoleList">
			
			<table width="880" cellspacing="0" cellpadding="0" border="0">
				<tbody>
					<tr>
						<td width="3" height="31">
							<img height="31" src="./images/table_01.gif" width="3" />
						</td>
						<td background="./images/table_02.gif" height="31">
							<table cellspacing="0" cellpadding="0" width="146" align="left"
								border="0">
								<tbody>
									<tr>
										<td width="51" background="./images/title_1_bg.gif">
											<img height="31" src="./images/title_1.gif" width="51" />
										</td>
										<td width="95" background="./images/title_1_bg.gif">
											<span class="color_b_666">角色管理</span>
										</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td width="3">
							<img height="31" src="./images/table_03.gif" width="3" />
						</td>
					</tr>
					<tr>
						<td width="3" background="./images/table_04.gif" width="3"
							align="right">
							<img height="100%" src="./images/table_04.gif" width="3" />
						</td>
						<td>
							<table width="770" border="0" align="center" cellpadding="0"
								cellspacing="1" bgcolor="#FF9900">
								<tr height="25">
									<th>
										角色编号
									</th>
									<th>
										角色名称
									</th>
									<th>
										角色描述
									</th>
									<th>
										<bean:message key="common.jsp.operation" />
										<a href="sysRole.do?method=list"> <u> <bean:message
													key="common.jsp.addlink" /></u> </a>
									</th>
								</tr>
								<logic:iterate name="sysRoleList" id="i" offset="startRowNo" length="pageSize">
									<tr bgcolor="ffffff" height="25" align="center">
										<td class="">
											<bean:write name="i" property="roleId" />
										</td>
										<td class="alt">
											<bean:write name="i" property="roleName" />
										</td>
										<td class="alt">
											<bean:write name="i" property="roleDesc" />
										</td>
										<td class="alt">
											<html:link href="sysRole.do?method=list&roleId=${i.roleId}">
												查看
											</html:link>
										</td>
									</tr>
								</logic:iterate>
								<tr height="25">
									<td align="center" colspan="6">
										<a href="sysRole.do?method=list&paging=first">首页</a>
										<a href="sysRole.do?method=list&paging=previous">上一页</a>
										<a href="sysRole.do?method=list&paging=next">下一页</a>
										<a href="sysRole.do?method=list&paging=last">尾页</a>
										&nbsp;&nbsp;&nbsp;&nbsp; 第
										<bean:write name="currPage" />
										/
										<bean:write name="maxPage" />
										页
									</td>
								</tr>
							</table>
						</td>
						<td background="./images/table_05.gif" width="3" align="left">
							<img height="100%" src="./images/table_05.gif" width="3">
						</td>
					</tr>
					<tr>
						<td height=3 valign="top">
							<img height="12px" src="./images/table_06.gif" width="3px">
						</td>
						<td height=3 valign="top">
							<img height="3px" src="./images/table_07.gif" width="100%">
						</td>
						<td height=3 valign="top">
							<img height="12px" src="./images/table_08.gif" width="3px">
						</td>
					</tr>
				</tbody>
			</table>
		</logic:present>
		<logic:present name="sysrole" scope="request">
				<html:form action="/sysRole">
					<table width="700" border="0" align="center" cellpadding="5" cellspacing="1"
						bgcolor="#FF9900">
						<tr>
							<td>
								角色编号
							</td>
							<td>
								<html:text readonly="true" property="sysrole.roleId"
									value="${sysrole.roleId}" />
							</td>
						</tr>
						<tr>
							<td>
								角色名称
							</td>
							<td>
								<html:text property="sysrole.roleName"
									value="${sysrole.roleName}" />
							</td>
						</tr>
						<tr>
							<td>
								角色描述
							</td>
							<td>
								<html:textarea property="sysrole.roleDesc"
									value="${sysrole.roleDesc}" />
							</td>
						</tr>
						<tr>
							<td>
								主菜单权限
							</td>
							<td>
							    <table width="600" border="0" align="center" cellpadding="5"
										cellspacing="1" bgcolor="#FF9900">
										
										<tr>
											<logic:present name="mmenulist">
												<%
												int i = 0, j = -1;
												%>
												<logic:iterate name="mmenulist" id="mml">
													<%
															i = 0;
															j = (j + 1) % 5;
															if (0 == j)
																out.print("</tr><tr>");
													%>
													<logic:present name="sltmmenulist">
														<logic:iterate name="sltmmenulist" id="smml">
															<logic:equal name="smml" property="MMenuId"
																value="${mml.MMenuId}">
																<%
																i = 1;
																%>
															</logic:equal>
														</logic:iterate>
													</logic:present>
													<td width="80">
														<input type="checkbox" id="mainmenus" name="mainmenus"
															value="<bean:write name="mml" property="MMenuId" />"
															<%=(1 == i ? "checked" : "")%> />
														<bean:write name="mml" property="MMenuName" />
													</td>
												</logic:iterate>
												<%
														for (; j < 4; j++)
														out.print("<td>&nbsp;</td>");
												%>
											</logic:present>
										</tr>
									</table>
							</td>
						</tr>
						<tr>
							<td>
								左菜单权限
							</td>
							<td>
							    <table width="600" border="0" align="center" cellpadding="5"
										cellspacing="1" bgcolor="#FF9900">
										
										<tr>
											<logic:present name="lmenulist">
												<%
												int i = 0, j = -1;
												%>
												<logic:iterate name="lmenulist" id="lml">
													<%
															i = 0;
															j = (j + 1) % 5;
															if (0 == j)
																out.print("</tr><tr>");
													%>
													<logic:present name="sltlmenulist">
														<logic:iterate name="sltlmenulist" id="slml">
															<logic:equal name="slml" property="LMenuId"
																value="${lml.LMenuId}">
																<%
																i = 1;
																%>
															</logic:equal>
														</logic:iterate>
													</logic:present>
													<td width="100">
														<input type="checkbox" id="leftmenus" name="leftmenus"
															value="<bean:write name="lml" property="LMenuId" />"
															<%=(1 == i ? "checked" : "")%> />
														<bean:write name="lml" property="LMenuName" />
													</td>
												</logic:iterate>
												<%
														for (; j < 4; j++)
														out.print("<td>&nbsp;</td>");
												%>
											</logic:present>
										</tr>
									</table>
							</td>
						</tr>
						<tr>
							<td>
								集成取数权限
							</td>
							<td>
							    <table width="600" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#FF9900">
										<tr>
											<logic:present name="templateList" scope="request">
												<% int i = 0, j = -1; %>
												<logic:iterate name="templateList" id="tmpt">
													<logic:notEqual name="tmpt" property="templateTypeId" value="20">
													<%
														i = 0;
														j = (j + 1) % 5;
														if (0 == j)
															out.print("</tr><tr>");
													%>
													<logic:present name="roleTemplate" scope="request">
														<logic:iterate name="roleTemplate" id="rt">
															<logic:equal name="rt" property="templateId" value="${tmpt.templateId}">
																<% i = 1; %>
															</logic:equal>
														</logic:iterate>
													</logic:present>
													<td width="100">
														<input type="checkbox" id="templateIds" name="templateIds" 
															value="<bean:write name="tmpt" property="templateId" />" 
															<%=(1 == i ? " checked" : "")%> />
														<bean:write name="tmpt" property="templateName" />
													</td>
													</logic:notEqual>
												</logic:iterate>
												<%
													for (; j < 4; j++)
														out.print("<td>&nbsp;</td>");
												%>
											</logic:present>
										</tr>
									</table>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center" valign="middle">
								<img src='images/button_modify.gif' width="63" height="21" onclick="opchange('save')" />
								&nbsp;&nbsp;
								<img src='images/button_delete.gif' width="63" height="21" onclick="opchange('delete')" />
								&nbsp;&nbsp;
								<img src='images/button_exit.gif' width="63" height="21" onclick="opchange('list')" />
							</td>
						</tr>
					</table>
					<html:hidden property="method" value="save" />
				</html:form>
		</logic:present>
		<logic:notPresent name="sysrole" scope="request" >
				<html:form action="/sysRole">
					<table width="400" border="0" align="center" cellpadding="5" cellspacing="1"
						bgcolor="#FF9900">
						<tr>
							<th align="center" colspan="2">
								<bean:message key="sysuser.jsp.addnew" />
							</th>
						</tr>
						<tr>
							<td>
								角色名称
							</td>
							<td>
								<html:text property="sysrole.roleName" value=""/>
							</td>
						</tr>
						<tr>
							<td>
								角色描述
							</td>
							<td>
								<html:textarea property="sysrole.roleDesc"
									value="" />
							</td>
						</tr>
						
						<tr>
							<td align="center" valign="middle" colspan="2">
								<img src='images/button_addnew.gif' width="63" height="21" onclick="opchange('save')" />
								&nbsp;&nbsp;
								<img src='images/button_cancel.gif' width="63" height="21" onclick="" />
							</td>
						</tr>
					</table>
					<html:hidden property="method" value="save" />
				</html:form>
		</logic:notPresent>
	</body>
</html>